Skip to content

Disable -pedantic conditionally; add -pedantic-errors and -Werror conditionally #387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 30, 2015
Merged

Disable -pedantic conditionally; add -pedantic-errors and -Werror conditionally #387

merged 2 commits into from
Oct 30, 2015

Conversation

joerg-krause
Copy link
Contributor

Add an option JSONCPP_WITH_STRICT_ISO to disable compilation with -pedantic for GCC. If jsoncpp is build with the JSONCPP_WITH_WARNING_AS_ERROR option -pedantic-errors is used instead.

Commit 912d550 disabled -Werror. Enable it if jsoncpp is build with JSONCPP_WITH_WARNING_AS_ERROR=ON.

'-pedantic' issues all warnings demanded by strict ISO C/C++; rejecting
extensions that do not follow ISO C/C++. Without this option, certain GNU
extensions and traditional C/C++ features are supported as well.

With this option enabled building jsoncpp fails with the musl toolchain on
x86 because of an incompatible posix_memalign declaration [1]. Without
'-pedantic' there is no error anymore and jsoncpp builds fine.

Add an option JSONCPP_WITH_STRICT_ISO to disable compilation with '-pedantic'
with GCC. If jsoncpp is build with the JSONCPP_WITH_WARNING_AS_ERROR option
'-pedantic-errors' is used instead.

[1] https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01425.html
Commit 912d550 disabled '-Werror'. Enable it
if jsoncpp is build with JSONCPP_WITH_WARNING_AS_ERROR=ON.
cdunn2001 added a commit that referenced this pull request Oct 30, 2015
Disable -pedantic conditionally; add -pedantic-errors and -Werror conditionally
@cdunn2001 cdunn2001 merged commit 9234cbb into open-source-parsers:master Oct 30, 2015
@cdunn2001
Copy link
Contributor

Sweet. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants